﻿using System;

namespace Microsoft.Xna.Framework
{
    /// <summary>
    /// 	Defines an interface for a game component that should be updated in Game.Update.
    /// </summary>
    public interface IUpdateable
    {
        #region Enabled

        /// <summary>
        /// 	Indicates whether the game component's Update method should be called in Game.Update.
        /// </summary>
        bool Enabled
        {
            get;
        }

        /// <summary>
        /// 	Raised when the Enabled property changes.
        /// </summary>
        event EventHandler<EventArgs> EnabledChanged;

        #endregion

        #region UpdateOrder

        /// <summary>
        /// 	Indicates when the game component should be updated relative to other game components. Lower values are updated first.
        /// </summary>
        int UpdateOrder
        {
            get;
        }

        /// <summary>
        /// 	Raised when the UpdateOrder property changes.
        /// </summary>
        event EventHandler<EventArgs> UpdateOrderChanged;

        #endregion

        /// <summary>
        /// 	Called when the game component should be updated.
        /// </summary>
        /// <param name = "gameTime">Snapshot of the game's timing state.</param>
        void Update(GameTime gameTime);
    }
}